package com.example.demo.course.service;

import com.example.demo.course.Course;
import org.springframework.stereotype.Service;

@Service
public class TestService {
    private final CourseService courseService;

    public TestService(CourseService courseService) {
        this.courseService = courseService;
    }

    public void addTestCourse() {
        Course course = new Course();
        course.setName("测试课程");
        course.setTime("周 1 1 - 2 节");
        course.setLocation("教室 101");
        course.setTeacher("测试教师");
        course.setType("mandatory");

        Course savedCourse = courseService.saveCourse(course);
        System.out.println("保存的课程 ID: " + savedCourse.getId());
    }
}